import request from '@/router/axios'; // 供应商产品质量PPM统计表

// 搜索供应商
export const getSupplier = (supplierTypes) => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/supplierListNoPage',
    method: 'get',
    params: {
      supplierTypes
    }
  })
}

// 列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/hg-quality/supplierppm/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

// 删除
export const remove = (ids) => {
  return request({
    url: '/api/hg-quality/supplierppm/remove',
    method: 'post',
    params: {
      ids
    }
  })
}
// 新增-编辑
export const submit = (data, type) => {
  return request({
    url: `/api/hg-quality/supplierppm/${type}`,
    method: "post",
    data: data
  });
};

// 详情
export const detail = id => {
  return request({
    url: `/api/hg-quality/supplierppm/detail`,
    method: "get",
    params: {
      id
    }
  });
};

// 提交
export const startProcess = id => {
  return request({
    url: `/api/hg-quality/supplierppm/start-process`,
    method: "post",
    params: {
      id
    }
  });
};

export const getPPM = (params) => {
  return request({
    url: `/api/hg-quality/supplierppm/list`,
    method: "get",
    params
  });
};

